<div class="row">
	<div class="col-md-9 col-xs-9 col-md-offset-2">

		<div class="panel panel-default">
			<div class=" panel-heading media clearfix">
				<%= render partial:"topics/topic_info" ,locals:{topic: @topic}%>
			</div>

			<div class="panel-body">
				<article>
					<%=raw @topic.body_html%>
				</article>
			</div>
			<div class="panel-footer clearfix">
				<%= render 'topics/bottom'%>
				<!-- 点赞 取消 屏蔽 置顶 加精 ...-->
			</div>
		</div>

		<% if @replies.blank?%>
		<div class="no reply" style="text-align: center;padding: 10px 20px">
					暂时没有回复
		</div>
		<%else%>
			<!--<div class="row">-->
			<div id="replies" class="panel panel-default">
				<div class="panel-heading">
					共<%= @topic.replies_count%>条回复
				</div>
				<div class="panel-body " id="reply_body">
							<%= render partial: "replies/reply", collection: @replies%>
				</div>
			</div>
			<!--</div>-->
		<%end%>


		<% if current_user.present? %>
		<div class="panel panel-default ">
			<div class="panel-heading">回帖</div>
				<div class="panel-body clearfix">

						<%= form_for(Reply.new,remote: true,url: topic_replies_path(@topic)) do |f| %>
							<div class="form-group">
								<%=f.text_area :body,class:'form-control topic-editor',row: '4'%>
							</div>
							<div class="submit">
                                       			<button type="submit" class="btn btn-primary" onclick="window.location.reload()">提交</button>

							</div>
						<%end%>
				</div>
		</div>

		<%else%>

					<div class=" panel panel-default">
						<div class="panel-body" style="padding: 20px">
						需要<%= link_to "登陆",new_user_session_path,class: 'btn btn-primary'%>后方可回复,如果你还没有账号,请点击这里
						<%= link_to '注册',new_user_registration_path,class: 'btn btn-danger'%>

						</div>
					</div>
		<%end%>
	</div>
</div>
